s = input()
n =len(s)
dp = [[0 for _ in range(2)] for _ in range(n)]  # 代表取第i个字符或者不取的最大价值
dp[0][1] = ord(s[0])-ord('a')+1
for i in range(1,n):
    dp[i][0] = max(dp[i-1][1],dp[i-1][0])
    dp[i][1] = dp[i-1][0]+ord(s[i])-ord('a')+1

print(max(dp[n-1][0],dp[n-1][1]))